window.onload = function () {

    // 数据加载完成之后，关闭加载动画
    // setTimeout(function () {
    //     $('.spinner').fadeOut();
    // },3000);

    // 打开输入弹出框pop-message
    $('.status-red').click(function () {

        $('.pop-message').fadeIn();
        $(".popup-bg").fadeIn();
    });
    // 关闭输入弹出框pop-messge
    $('.pop-close').click(function () {
       $('.pop-message').fadeOut();
        $(".popup-bg").fadeOut();
    });
    
};

// 打开搜索框
function openSearchBox() {
    $(".search-box").addClass("search-box-slide");
    $(".popup-bg").fadeIn(300);
}
// 关闭搜索框
function closeSearchBox() {
    $(".search-box").removeClass("search-box-slide");
    $(".popup-bg").fadeOut();
}

/*********顶部弹框设置***********/

//设置cookie
function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*1000));
    var expires = "expires="+d.toUTCString();
    document.cookie = cname + "=" + cvalue + "; " + expires;
}
//获取cookie
function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1);
        if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
    }
    return "";
}
//清除cookie
function clearCookie(name) {
    setCookie(name, "", -1);
}
var admin=getCookie('user');

if(admin!='admin'){
    // 今日推荐弹框
    $('.today-update').addClass('slide-top-update');
    setCookie('user','admin',60*60*8);
}





